package com.feicheng.lanniao.controller;



import java.util.List;

import javax.imageio.spi.RegisterableService;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.feicheng.lanniao.entity.Client;
import com.feicheng.lanniao.entity.Person;
import com.feicheng.lanniao.exception.SystemException;
import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.IClientService;
import com.feicheng.lanniao.service.IPersonService;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-02
 */
@RestController
@RequestMapping("/lanniao-admin/client-login")
public class UserLoginController {
	@Autowired
	HttpSession session;
	@Autowired
	IClientService IClientService;

	/**
	 * 用户登录方法
	 * @param client
	 * @return
	 */
	@PutMapping("/login")
	public ResultInfo login(Client client) {
		return IClientService.login(client);
	}

	/**
	 * 用户退出方法
	 * @param session
	 * @return
	 */
	@PostMapping("/logout")
	public ResultInfo logout(HttpSession session) {
		session.invalidate();
		return ResultInfo.bindingFail("用户退出登录成功！");
	}
}
